
import request from '@/config/axios'

// export const getAgentOrder = async (params) => {
//   return await request.get({ url: `/trade/agent-order/page`, params })
// }
// system/agent-users/page
// interface AgentOrderVO {
//   agentName:string,
//   username:string,
//   nickname:string,
//   password:string,
//   mobile:string
// }
export const getAagentUsers = async (params) => {
  return await request.get({ url: `/system/agent-users/page`, params })
}
// 
// export const getStoreList = async (params) => {
//   return await request.get({ url: `/system/agent-users/store/list`, params })
// }  
// 
export const createAgent = async (data: any) => {
  return await request.post({ url: `/system/agent-users/create`, data })
}
// system/agent-users/update
export const updateAgent = async (data: any) => {
  return await request.put({ url: `/system/agent-users/update`, data })
}

// 获取代理商详情
export function getAgentDetail(id: string | number) {
  return request.get({ url: `/agent/${id}` })
}
// system/agent-users/store/list
export const getAgentStoreList = async (params: any) => {
  return await request.get({ url: `/system/agent-users/store/list`, params })
}
// system/agent-users/status/update
export const updateAgentStatus = async (data: any) => {
  return await request.put({ url: `/system/agent-users/status/update`, data })
}
// trade/agent-area/agent/page
export const getAgentAreaPage = async (params: any) => {
  return await request.get({ url: `/trade/agent-area/agent/page`, params })
}
// trade/agent-area/children
export const getAgentAreaChildren = async (params: any) => {
  return await request.get({ url: `/trade/agent-area/children`, params })
}
// system/agent-users/detail
export const getAgentUsersDetail = async (params:any) => {
  return await request.get({ url: `/system/agent-users/detail` ,params })
}
// system/agent-users/withdraw/page
export const getAgentUsersWithdrawPage = async (params:any) => {
  return await request.get({ url: `/trade/agent-commission-withdraw/page` ,params })
}
// trade/agent-area/add
export const addAgentArea = async (data:any) => {
  return await request.post({ url: `/trade/agent-area/add`, data })
}
// trade/agent-area/agent/page
export const getAgentAreaAgentPage = async (params:any) => {
  return await request.get({ url: `/trade/agent-area/agent/page` ,params })
}
// agent-users/commission/update
export const updateCommission = async (data:any) => {
  return await request.post({ url: `/agent-users/commission/update`, data })
}
// trade/agent-order/page
export const getAgentOrderPage = async (params:any) => {
  return await request.get({ url: `/trade/agent-order/page` ,params })
}
// system/agent-users/status/update
export const updateAgentUsersStatus = async (data:any) => {
  return await request.put({ url: `/system/agent-users/status/update`, data})
}
// system/agent-users/config/rule/update
export const updateAgentUsersConfigRule = async (data:any) => {
  return await request.put({ url: `/system/agent-users/config/rule/update`, data})
}
// system/agent-users/config/rule/detail
export const getAgentUsersConfigRule = async () => {
  return await request.get({ url: `/system/agent-users/config/rule/detail`})
}
// trade/agent-region-config-share/get
export const getAgentRegionConfigShare = async () => {
  return await request.get({ url: `/trade/agent-region-config-share/get`})
}
// agent-users/store/relation/bind
export const bindAgentUsersStoreRelation = async (data:any) => {
  return await request.post({ url: `/system/agent-users/store/relation/bind`, data})
}
// trade/agent-region-config-share/saveOrUpdate
export const saveOrUpdateAgentRegionConfigShare = async (data:any) => {
  return await request.post({ url: `/trade/agent-region-config-share/saveOrUpdate`, data})
}
// trade/agent-area/delete-area
export const deleteAgentArea = async (params:any) => {
  return await request.delete({ url: `/trade/agent-area/delete-area`, params})
}
// trade/agent-commission-withdraw/page
export const getAgentCommissionWithdrawPage = async (params:any) => {
  return await request.get({ url: `/trade/agent-commission-withdraw/page`, params})
}
// trade/agent-commission-withdraw/get
export const getAgentCommissionWithdraw= async(id:any)=>{
  return await request.get({ url: `/trade/agent-commission-withdraw/get`, params:{id}})
}
// trade/agent-commission-withdraw/update-transferred
export const updateAgentCommissionWithdrawTransferred = async (data:any) => {
  return await request.put({ url: `/trade/agent-commission-withdraw/update-transferred`, data})
}
// trade/agent-commission-withdraw/approve
export const approveAgentCommissionWithdraw = async (id:any) => {
  return await request.put({ url: `/trade/agent-commission-withdraw/approve`, params:{id}})
}
// trade/agent-commission-withdraw/reject
export const rejectAgentCommissionWithdraw = async (data:any) => {
  return await request.put({ url: `/trade/agent-commission-withdraw/reject`, data})
}
// trade/agent-commission-withdraw/success
export const successAgentCommissionWithdraw = async (data:any) => {
  return await request.put({ url: `/trade/agent-commission-withdraw/success`, data})
}


